import { AxiosPro } from "@/utils/AxoisPro";
export class UserApi {
  static async login(data) {
    return AxiosPro.post("/user/login", data);
  }
  static async register(data) {
    return AxiosPro.post("/user/register", data);
  }
}

export class ArticleApi {
  /*
   * @params {Object} params  query参数
   * @params {Number} params.pageNum
   * @params {Number} params.pageSize
   */
  static async getArticleList(params) {
    return AxiosPro.get("/interview/query", params);
  }
  //optType 1点赞 2收藏
  static async getArticleOptList(params) {
    return AxiosPro.get("/interview/opt/list", params);
  }
  static async getArticleDetail(id) {
    return AxiosPro.get("/interview/show", { id });
  }
  //  点击收藏 /h5/interview/opt的接口
  static async optArticle(id, optType) {
    return AxiosPro.post("/interview/opt", {
      id,
      optType,
    });
  }
}
